<include file="public@header">
<link href="__STATIC__/css/layui.css" rel="stylesheet" />
<link href="__STATIC__/css/admin.css" rel="stylesheet" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<div class="row">
            <div class="layui-card-body">
              	<div class="layui-carousel layadmin-carousel layadmin-backlog" lay-anim="" lay-indicator="inside" lay-arrow="none" style="width: 100%; height: 80px!important;">
	                <div carousel-item="">
	                  	<ul class="layui-row layui-col-space10 layui-this">
	                    	<li class="layui-col-xs3">
	                      		<a href="javascript:;" class="layadmin-backlog-body">
	                        		<h3>总提现金额</h3>
	                        		<p><cite>{$total_amount}</cite>USDT</p>
	                      		</a>
	                    	</li>
	                    	<li class="layui-col-xs3">
	                      		<a href="javascript:;" class="layadmin-backlog-body">
	                        		<h3>待提现金额</h3>
	                        		<p><cite>{$examine_amount}</cite>USDT</p>
	                      		</a>
	                    	</li>
	                    	<li class="layui-col-xs3">
	                      		<a href="javascript:;" class="layadmin-backlog-body">
	                        		<h3>今日提现金额</h3>
	                        		<p><cite>{$today_amount}</cite>USDT</p>
	                      		</a>
	                    	</li>
	                    	<li class="layui-col-xs3">
		                      	<a href="javascript:;" class="layadmin-backlog-body">
		                        	<h3>本月提现金额</h3>
		                        	<p><cite>{$month_amount}</cite>USDT</p>
		                      	</a>
		                    </li>
	                  	</ul>
	                </div>
            	</div>
          	</div>
        </div>
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('tixian/index')}">提现列表</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('tixian/index')}">
            关键词:
            <input type="text" class="form-control" name="keyword" style="width: 200px;" value="{:input('request.keyword/s','')}" placeholder="手机|邮箱">
            地址:
            <input type="text" class="form-control" name="address" style="width: 200px;" value="{:input('request.address/s','')}" placeholder="地址">
            状态:
            <select class="form-control" name="status" style="width: 120px;">
				<option value="">---请选择---</option>
				<option value="0" <if input('status') == 0 && input('status') != null>selected</if> >待审核</option>
				<option value="1" <if input('status') == 1 && input('status') != null>selected</if> >通过</option>
				<option value="2" <if input('status') == 2 && input('status') != null>selected</if> >未通过</option>
            </select>
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('tixian/index')}">清空</a>
            <a class="btn btn-success" href="{:url('tixian/export',array('keyword'=>input('keyword'),'address'=>input('address'),'status'=>input('status')))}" target="_blank">导出</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>手机</th>
					<th>邮箱</th>
					<th>币种</th>
					<th>提现地址</th>
					<th>提现数量</th>
					<th>手续费</th>
					<th>状态</th>
					<th>理由</th>
					<th>提交时间</th>
					<th>交易hash值</th>
					<th>交易状态</th>
					<th>审核编号</th>
					<th>审核时间</th>
					<th width="140">{:lang('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<php>$status_text = ['0'=>'待审核','1'=>'通过','2'=>'未通过','3'=>'上链审核中','4'=>'上链取消'];$state_text = ['0'=>'交易进行中','1'=>'交易成功','2'=>'交易失败'];</php>
				<foreach name="list" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td>{$vo.mobile}</td>
					<td>{$vo.user_email}</td>
					<td>{$vo.symbol}</td>
					<td>{$vo.address}</td>
					<td>{:floatval($vo.number)}</td>
					<td>{:floatval($vo.tx_sxf)}</td>
					<td>{$status_text[$vo.status]}</td>
					<td>{$vo.reason}</td>
					<td>{:date('Y-m-d H:i',$vo.create_time)}</td>
					<td>{$vo.hash}</td>
					<td><if $vo.state>{$state_text[$vo.state]}</if></td>
					<td>{$vo.ztpay_number}</td>
					<td><if $vo.operation_time>{:date('Y-m-d H:i',$vo.operation_time)}</if></td>
					<td>
						<if $vo.status == 0>
							<a class="btn btn-xs btn-primary examine" data-id="{$vo.id}">审核</a>
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script src="__STATIC__/layui/layui.js"></script>
	<script type="text/javascript">
	layui.use('layer',function(){
		$('.examine').click(function(){
			var id = $(this).data('id');
			layer.confirm('审核后将向该地址打款！', {
			  	btn: ['通过','不通过'] //按钮
			}, function(){
				$.ajax({
					type: 'post',
					url: '{:url("tixian/examine")}',
					data: {id:id,act:'yes'},
					success:function(res){
						console.log(res)
						if(res.code == 1){
							layer.msg(res.msg,{icon:1});
							setTimeout(function(){ location.reload(); }, 1500);
						}else{
							layer.msg(res.msg,{icon:2});
						}
					}
				});
			}, function(){
				layer.prompt({title:'填写拒绝理由'},function(value, index, elem){
				  	$.ajax({
						type: 'post',
						url: '{:url("tixian/examine")}',
						data: {id:id,act:'no',reason:value},
						success:function(res){
							if(res.code == 1){
								layer.msg(res.msg,{icon:1});
								setTimeout(function(){ location.reload(); }, 1500);
							}else{
								layer.msg(res.msg,{icon:2});
							}
						}
					});
				  	layer.close(index);
				});
			});
		});
	});
	</script>
</body>
</html>